package cn.lg.soar.system.feign.fallback;

import cn.lg.soar.system.feign.UserCurrBindApiFeign;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.io.Serializable;
import java.util.Map;

/**
 * @author luguoxiang
 * @date 2022/1/2
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
public class UserCurrBindApiFallbackFactory implements FallbackFactory<UserCurrBindApiFeign> {
    protected static final Logger LOGGER = LoggerFactory.getLogger(UserCurrBindApiFallbackFactory.class);
    @Override
    public UserCurrBindApiFeign create(Throwable cause) {
        return new UserCurrBindApiFeign() {

            @Override
            public boolean set(Map<String, Serializable> map) {
                LOGGER.error("set：{}", map, cause);
                return false;
            }

            @Override
            public Map<String, Object> get() {
                LOGGER.error("get", cause);
                return null;
            }

        };
    }

}
